#ifndef OS_TASK_COM_H
#define OS_TASK_COM_H
#include "os_type.h"
#include "os_config.h"
#define OS_ALWAYS_DELAY 0
#define OS_NO_DELAY 0xffffffff
typedef enum{
	TET_SEM_BIN,
	TET_SEM_CNT,
	TET_MUTEX,
	TET_QUEUE
}OS_TASKCOM_EVENT_TYPE;
typedef enum{
	TES_IDLE,
	TES_BUSY,
	TES_EMPTY,
	TES_NOT_EMPTY
}OS_TASKCOM_ENENT_STATE;
typedef struct os_event{
	OS_TASKCOM_EVENT_TYPE  Type;
	OS_TASKCOM_ENENT_STATE State;
	u16 Cnt;
	s16 Info;
	u16 Volume;
	u16 Front;
	u16 Rear;
	void * *Buf;
	volatile u32 WaitList[2];
	u32 *WaitListBitBand;
}OS_EVENT;
void OSSemBinCreat(OS_EVENT *EventHandle,u32 State);
void OSSemBinGive(OS_EVENT *EventHandle);
OS_STATE OSSemBinTake(OS_EVENT *EventHandle,u32 Ticks);
void OSSemCntCreat(OS_EVENT *EventHandle,u32 Cnt);
void OSSemCntGive(OS_EVENT *EventHandle);
OS_STATE OSSemCntTake(OS_EVENT *EventHandle,u32 Ticks);
void OSMutexCreat(OS_EVENT *EventHandle);
void OSMutexGive(OS_EVENT *EventHandle);
void OSMutexTake(OS_EVENT *EventHandle);
void OSQueueCreat(OS_EVENT *EventHandle,u32 MaxNum,void * *Buf);
void OSQueueSend(OS_EVENT *EventHandle,void *Msg);
OS_STATE OSQueueReceive(OS_EVENT *EventHandle,void * *pMsg,u32 Ticks);
#endif
